{% extends 'base.html' %}
{% block title %}
    论坛详情
{% endblock %}
{% block content_left %}
    <div class="col-md-9 cl-left">

        <div class="cl-cantainer container">
            <div class="row">
                <div class="col-md-12 cl-left">
                    <div class="cl-artical-content">
                        <h2 class="cl-artical-title">{{ article.title }}</h2>
                        <div class="cl-card-tag">
                            <div><span>作者：{{ article.author }}</span></div>
                            <div><span>{{ article.total_views }}</span>人浏览 / <span>{{ article.comments_count }}</span>人评论</div>
                            <div><span>发布时间：{{ article.create_time }}</span></div>
                        </div>
                        <img src="{{ article.avatar.url }}" class="img-fluid" alt="">
                        <div class="cl-artical">
                            {{ article.content | safe }}
                        </div>
                    </div>
                    <div class="recommend-panel">
                        <h4 class="right-card-title">相关文章</h4>
                        <div class="card-deck">
                           {% for corrtag in corrtags %}
                                <div class="card ll-panel">
                                    <a class="recommend-panel-link" href="{% url 'home:detail' %}?art_id={{ corrtag.id }}">
                                        <div class="recommend-panel-top">
                                            <img src="{{ corrtag.avatar.url }}"  class="img-fluid" alt="">
                                        </div>
                                        <div class="recommend-panel-bottom">
                                            {{ corrtag.sumary }}
                                        </div>
                                    </a>
                                </div>
                            {% endfor %}
                        </div>
                    </div>
                    {#             文章评论#}
                    <div class="comment">
                        <form class="cl-comment-from" method="post">
                            {% csrf_token %}
                            <input type="hidden" name="art_id" value="{{ article.id }}">
                            <div><textarea placeholder="说点什么吧..." rows="5" name="content"></textarea></div>
                            <button type="submit">评论</button>
                            <span class="clearfix"></span>
                        </form>
                        <h4 class="right-card-title">全部评论</h4>
                        {% for comm in comms %}
                            <div class="comment-panel">
                                <div class="comment-panel-portrait">
                                    {% if comm.user.avatar %}
                                        <img src="{{ comm.user.avatar.url }}" class="img-fluid rounded-circle" alt="">
                                    {% else %}
                                        <img src="../static/img/portrait.png" alt="">
                                    {% endif %}
                                </div>
                                <div class="comment-panel-content">
                                    <div class="comment-panel-content-item">
                                        <div class="comment-author">{{ comm.user.username }}</div>
                                        <div>{{ comm.created_time }}</div>
                                    </div>
                                    <div class="comment-panel-content-main">{{ comm.content }}</div>
                                </div>
                                <span class="clearfix"></span>
                                {#                        <div class="text-primary"><a href="">回复</a></div>#}
                            </div>
                        {% endfor %}
                    </div>
                </div>
            </div>
        </div>
    </div>



{% endblock %}